package com.entity;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;


/**
 * 知识信息 数据库通用操作实体类（普通增删改查）
 *
 * @author
 * @email
 * @date 2022-03-24 19:25:36
 */
@TableName("zhishixinxi")
@Document(indexName = "zhishixinxi")
@Data
public class ZhishixinxiEntity<T> implements Serializable {

  private static final long serialVersionUID = 1L;


  public ZhishixinxiEntity() {

  }

  public ZhishixinxiEntity(T t) {
    try {
      BeanUtils.copyProperties(this, t);
    } catch (IllegalAccessException | InvocationTargetException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }

  /**
   * 主键id
   */
  @TableId
  @Id
  private String id;
  /**
   * 知识标题
   */
  @Field(type = FieldType.Text)
  private String zhishibiaoti;

  /**
   * 项目分类
   */
  @Field(type = FieldType.Keyword)
  private String xiangmufenlei;

  /**
   * 标签分类
   */
  @Field(type = FieldType.Keyword)
  private String biaoqianfenlei;

  /**
   * 知识文件
   */
  @Field(type = FieldType.Text)
  private String zhishiwenjian;

  /**
   * 知识封面
   */
  @Field(type = FieldType.Text)
  private String zhishifengmian;

  /**
   * 发布日期
   */

  @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
  @DateTimeFormat
  @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd")
  private Date faburiqi;

  /**
   * 用户账号
   */
  @Field(type = FieldType.Keyword)
  private String yonghuzhanghao;

  /**
   * 用户姓名
   */
  @Field(type = FieldType.Keyword)
  private String yonghuxingming;

  /**
   * 知识内容
   */
  @Field(type = FieldType.Text)
  private String zhishineirong;

  /**
   * 是否审核
   */
  @Field(type = FieldType.Keyword)
  private String sfsh;

  /**
   * 审核回复
   */
  @Field(type = FieldType.Text)
  private String shhf;

  /**
   * 最近点击时间
   */

//  @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
//  @DateTimeFormat
  @Field(type = FieldType.Date)
  private Date clicktime;

  /**
   * 点击次数
   */
  @Field(type = FieldType.Integer)
  private Integer clicknum = 0;


//  @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
//  @DateTimeFormat
  @Field(type = FieldType.Date)
  private Date addtime;
}
